import jQuery from 'jquery'
import 'popper.js'
import 'bootstrap'
import 'layui'
import http from 'axios'



http({
  url: `https://gank.io/api/v2/post/${getQuery('id')}`
}).then(res => {
  const { data } = res.data
  console.log(data)

  jQuery('.title').html(data.title)
  jQuery('.type').html(data.category)
  jQuery('.desc').html(data.desc)
  jQuery('.time').html(data.createdAt)
})


function getQuery(key) {
  let arr = location.search.slice(1).split('&')
  for (let item of arr) {
    let item_temp = item.split('=')

    if (item_temp[0] === key) {
      return item_temp[1]
    }
  }
}




